<h2 class="jquery_tab_title">用户设置</h2>
<div class='message success main' style='display: none;'>
	<p><strong> 用户设置 </strong>保存成功</p>
</div>
<div class='message success pwd' style='display: none;'>
	<p><strong> 用户密码 </strong>修改成功</p>
</div>
<form id='user_setting_form'>
	<fieldset>
	<legend>账户信息</legend>
	<p>&nbsp;&nbsp;&nbsp;用户名：<span style='color: #f60;'><?php echo $user_data['name'] ?></span></p>
	<p>用户密码：<input class='button' type='button' value='点击修改' id='change_pwd'/></p>
	
	<div id='us_change_pwd_dialog' title='修改管理员密码'>
	<p>
		<span>原始密码</span>
		<input class='input-small' type='password' value='' id='old_pwd'/>
	</p>
	<p>
		<span>修改密码</span>
		<input class='input-small' type='password' value='' id='pwd'/>
	</p>
	<p>
		<span>确认密码</span>
		<input class='input-small' type='password' value='' id='re_pwd'/>
	</p>
	<div id='change_pwd_msg'></div>
	</div>
	<script>
	$("#us_change_pwd_dialog").dialog({
		autoOpen: false,
		resizable: false,
		draggable: false,
		width: 300,
		height: 300,
		modal: true,
		buttons: {
			"确定": function() {
				var old_pwd = $("#us_change_pwd_dialog #old_pwd").val();
				var pwd = $("#us_change_pwd_dialog #pwd").val();
				var re_pwd = $("#us_change_pwd_dialog #re_pwd").val();
				
				Admin.us.change_pwd(old_pwd, pwd, re_pwd);
				$(this).ajaxComplete(function(){
					if (Admin.us.change_pwd_is_succeed == true) {
						$( this ).dialog( "close" );
						$(".message.success.pwd").css({ "display": "block" });
						setTimeout("$('.message').slideUp(200)", 3000);
					}
				});
			},
			"取消": function() {
				$( this ).dialog( "close" );
			}
		}
	});
	</script>
	
	<p>注册时间：<span><?php echo date("Y-m-d H:i", $user_data['create_time']) ?></span></p>
	<p>用户类型：<span><?php echo $this->common_data->_get_admin_category_name_by_cid($admin_data['category_id']) . ' - ' . $this->common_data->_get_user_category_name_by_cid($user_data['category_id']) ?></span></p>
	<p>
		<span>电子邮箱</span>
		<input class='input-medium' type='text' value='<?php echo $user_data['email'] ?>' id='email'/>
	</p>
	</fieldset>
	
	<fieldset>
	<legend>个人基本信息</legend>
	<p>
		<span>姓名</span>
		<input class='input-small' type='text' value='<?php echo $admin_data['admin_name'] ?>' id='admin_name'/>
	</p>
	<p>
		<span>性别</span>
		<select id='admin_gender'>
		<option value='' selected='selected'>请选择</option>
		</select>
		<script>
		$(function() {
			//生成性别下拉菜单
			var gender_array = getAllGender();
			for (var i= 0; i < gender_array.length; i++) {
				$('#admin_gender').append("<option value=" + (i + 1) + ">" + gender_array[i] + "</option>");
			}
			//给下拉菜单绑值
			$('#admin_gender option').each(function() {
				if($(this).val() == <?php echo $admin_data['admin_gender'] + "" ?>) {
					$(this).attr("selected", "selected");
				}
			});
		});
		</script>
	</p>
	<p>
		<span>生日</span>
		<input class='input-small' type='text' value='<?php echo $admin_data['admin_birth'] ?>' id='admin_birth'/>
	</p>
	
	<?php if ($admin_data['category_id'] != ADMIN_TEACHER_CID):?>
	<p>
		<span>学号</span>
		<input class='input-small' type='text' value='<?php echo $admin_data['admin_stu_num'] ?>' id='admin_stu_num'/>
	</p>
	<p>
		<span>学院</span>
		<select id='admin_col' onchange='f_change_col_pro(this,document.getElementById("admin_pro"));'>
		<option value='' selected='selected'>请选择</option>
		</select>
		<script>
		$(function() {
			//生成学院下拉菜单
			var col_array = getAllCol();
			for (var i= 0; i < col_array.length; i++) {
				$('#admin_col').append("<option value=" + col_array[i][0] + ">" + col_array[i][1] + "</option>");
			}
			//给下拉菜单绑值
			$('#admin_col option').each(function() {
				if($(this).val() == <?php echo $admin_data['admin_col'] + "" ?>) {
					$(this).attr("selected", "selected");
				}
			});
		});
		</script>
	</p>
	<p>
		<span>专业</span>
		<select id='admin_pro'>
		<option value='' selected='selected'>请选择</option>
		</select>
		<script>
		$(function() {
			//生成学院对应的专业的下拉菜单并给下拉菜单绑值
			var val = $('#admin_col').val();
			var pro_array = getProByColId(val);
			for (var i= 0; i < pro_array.length; i++) {
				$('#admin_pro').append("<option value=" + pro_array[i][0] + ">" + pro_array[i][1] + "</option>");
			}
			$('#admin_pro option').each(function() {
				if($(this).val() == <?php echo $admin_data['admin_pro'] + "" ?>) {
					$(this).attr("selected", "selected");
				}
			});
		});
		</script>
	</p>
	<?php endif;?>
	
	<p>
		<span>电话</span>
		<input class='input-small' type='text' value='<?php echo $admin_data['admin_phone'] ?>' id='admin_phone'/>
	</p>
	<p>
		<span>&nbsp;QQ</span>
		<input class='input-small' type='text' value='<?php echo $admin_data['admin_qq'] ?>' id='admin_qq'/>
	</p>
	</fieldset>
	
	<input class='button us' id='modify_submit' type='button' value='确定修改'/>
	<input class='button' type='reset' value='重置表单'/>
</form>
				